<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h3 class="title">Editar Cadastro Individual</h3>

            <h:form id="form" enctype="multipart/form-data">

                <p:growl id="messages" showDetail="false" autoUpdate="true"  />
                <hr/>

                <p:tabView id="tabView" styleClass="fixedTabsLeft" orientation="left" dynamic="true">
                    <p:tab id="tabf" title="Dados Gerais">

                        <h5 class="title">Cabeçalho</h5>
                        <p:panel id="cabecalhoPanel" styleClass="container_24 clearfix withoutBorder">

                            <p:outputLabel value="Nº do cartão SUS do profissional:" styleClass="grid_8" for="susProfissional"/>
                            <p:inputText id="susProfissional" styleClass="grid_6" 
                                         required="true" requiredMessage="Nº do cartão SUS é obrigatório !"
                                         value="#{managerEditarCadastroIndividual.cadastroEditar.profissional.numeroCartaoSus}">
                                <script type="text/javascript">
                                    $(document).ready(function(){
                                        $('#form\\:tabView\\:susProfissional').attr('readonly', 'readonly');
                                    });
                                </script>
                            </p:inputText>
                            <div>
                                <p:commandButton id="pesquisarProfissional" icon="ui-icon-search"
                                                 process="@this"
                                                 rendered="#{managerEditarCadastroIndividual.cadastroEditar.profissional.id eq null}"
                                                 onclick="dialogProfissional.show()"/>
                                <p:commandButton id="removerProfissional" icon="ui-icon-trash"
                                                 update=":form:tabView:cabecalhoPanel" process="@this"
                                                 rendered="#{managerEditarCadastroIndividual.cadastroEditar.profissional.id ne null}"
                                                 actionListener="#{managerEditarCadastroIndividual.removerProfissional()}"/>
                            </div>
                            <div class="clear-both"/>

                            <p:outputLabel value="Nome:" styleClass="grid_8" for="nomeProfissional" />
                            <p:inputText id="nomeProfissional" styleClass="grid_15" readonly="true"
                                         value="#{managerEditarCadastroIndividual.cadastroEditar.profissional.nome}" />
                            <div class="clear-both"/>

                            <p:outputLabel value="Cod. CNES unidade:" styleClass="grid_8" for="cnes" />
                            <p:inputText id="cnes" styleClass="grid_6" readonly="true"
                                         value="#{managerEditarCadastroIndividual.cadastroEditar.profissional.equipe.unidade.codigoCNES}" />

                            <p:outputLabel value="Microárea:" styleClass="grid_4 alpha" for="microarea" />
                            <p:inputText id="microarea" styleClass="grid_5" readonly="true"
                                         value="#{managerEditarCadastroIndividual.cadastroEditar.profissional.microArea.nome}" />
                            <div class="clear-both"/>

                            <p:outputLabel value="Cod. equipe (INE):" styleClass="grid_8" for="equipeIne" />
                            <p:inputText id="equipeIne" styleClass="grid_6" readonly="true"
                                         value="#{managerEditarCadastroIndividual.cadastroEditar.profissional.equipe.codigo}" />

                            <p:outputLabel value="Data:" styleClass="grid_4 alpha" for="dataCadastro" />
                            <p:calendar id="dataCadastro" styleClass="grid_5"
                                        showOn="both" locale="pt" yearRange="1900:2020" 
                                        navigator="true" pattern="dd/MM/yyyy"
                                        value="#{managerEditarCadastroIndividual.cadastroEditar.dataCadastro}" />
                            <div class="clear-both"/>

                        </p:panel>

                        <h5 class="title">Responsável familiar</h5>
                        <p:panel id="responsavelPanel" styleClass="container_24 clearfix withoutBorder">

                            <p:selectOneRadio id="responsavelFamiliar" styleClass="grid_5"
                                              value="#{managerEditarCadastroIndividual.cadastroEditar.responsavelFamiliar}">
                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                <p:ajax update=":form:tabView:responsavelPanel" />
                            </p:selectOneRadio>
                            <div class="clear-both"/><br/>

                            <div style="#{managerEditarCadastroIndividual.cadastroEditar.responsavelFamiliar eq false ? '' : 'display: none'}">
                                <p:outputLabel value="Nº do cartão SUS:" styleClass="grid_5" for="numeroCartaoSusResponsavel"/>
                                <p:inputText id="numeroCartaoSusResponsavel" styleClass="grid_6" 
                                             required="#{managerEditarCadastroIndividual.cadastroEditar.responsavelFamiliar eq false}" 
                                             requiredMessage="Nº do cartão SUS é obrigatório !"
                                             value="#{managerEditarCadastroIndividual.cadastroEditar.cartaoResponsavelFamiliar.numeroCartaoSus}">
                                    <script type="text/javascript">
                                        $(document).ready(function(){
                                            $('#form\\:tabView\\:susProfissional').attr('readonly', 'readonly');
                                        });
                                    </script>
                                </p:inputText>

                                <div class="grid_1 alpha">
                                    <p:commandButton id="pesquisarResponsavel" icon="ui-icon-search"
                                                     process="@this"
                                                     rendered="#{managerEditarCadastroIndividual.cadastroEditar.cartaoResponsavelFamiliar.id eq null}"
                                                     onclick="dialogResponsavel.show()"/>
                                    <p:commandButton id="removerResponsavel" icon="ui-icon-trash"
                                                     update=":form:tabView:responsavelPanel"
                                                     process="@this"
                                                     rendered="#{managerEditarCadastroIndividual.cadastroEditar.cartaoResponsavelFamiliar.id ne null}"
                                                     actionListener="#{managerEditarCadastroIndividual.removerResponsavel()}"/>
                                </div>

                                <p:outputLabel value="Data Nasc.:" styleClass="grid_6" for="dataNascCalendarResponsavel" />
                                <p:inputText id="dataNascCalendarResponsavel" styleClass="grid_5" readonly="true"
                                             value="#{managerEditarCadastroIndividual.cadastroEditar.cartaoResponsavelFamiliar.dataNascimento}">
                                    <f:convertDateTime parent="dd/MM/yyyy" locale="pt,BR"/>
                                </p:inputText>
                                <div class="clear-both"/>

                                <p:outputLabel value="Nome:" styleClass="grid_5" for="nomeResponsavelInputText"/>
                                <p:inputText id="nomeResponsavelInputText" styleClass="grid_18" readonly="true"
                                             value="#{managerEditarCadastroIndividual.cadastroEditar.cartaoResponsavelFamiliar.nome}"/>
                            </div>

                        </p:panel>

                        <h5 class="title">Dados Gerais</h5>
                        <fieldset>
                            <legend>IDENTIFICAÇÃO DO USUÁRIO / CIDADÃO</legend>

                            <p:panel id="cidadaoPanel" styleClass="container_24 clearfix withoutBorder">

                                <p:outputLabel value="Nº do cartão SUS:" styleClass="grid_5" for="numeroCartaoSus"/>
                                <p:inputText id="numeroCartaoSus" styleClass="grid_7"
                                             required="true" requiredMessage="Numero do cartao SUS do cidadão é obrigatório"
                                             value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.numeroCartaoSus}" />

                                <p:outputLabel value="Data Nasc.:" styleClass="grid_5 alpha" for="dataNascCalendar" />
                                <p:calendar id="dataNascCalendar" styleClass="grid_5 dataNascimentoCidadao"
                                            showOn="both" locale="pt" yearRange="1900:2020" 
                                            navigator="true" pattern="dd/MM/yyyy"
                                            value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.dataNascimento}" />
                                <div class="clear-both" />

                                <p:outputLabel value="Nome completo:" for="nome" styleClass="grid_5"/>
                                <p:inputText id="nome" styleClass="grid_18" 
                                             value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.nome}" />
                                <div class="clear-both" />

                                <p:outputLabel value="Apelido/Nome Social:" for="apelido" styleClass="grid_5"/>
                                <p:inputText id="apelido" styleClass="grid_7" 
                                             value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.apelido}" />

                                <p:outputLabel value="Nº NIS (PIS/PASEP):" styleClass="grid_5 alpha" for="pisPasep"/>
                                <p:inputText id="pisPasep" styleClass="grid_6" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.pisPasep}" />
                                <div class="clear-both" />

                                <p:outputLabel value="Sexo:" styleClass="grid_5" for="sexo" />
                                <div class="grid_7 selectOneMenu">
                                    <p:selectOneMenu id="sexo" panelStyle="width:150px;" 
                                                     value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.sexo}">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.sexo}"/>
                                        <p:ajax update=":form:tabView:gestantePuerperioPanel" />
                                    </p:selectOneMenu>
                                </div>

                                <p:outputLabel value="Raça/Cor:" styleClass="grid_5" for="racaCor" />
                                <div class="grid_6 selectOneMenu racaCor">
                                    <p:selectOneMenu id="racaCor" panelStyle="width:150px;" 
                                                     value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.racaCor}">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.racaCor}"/>
                                    </p:selectOneMenu>
                                </div>
                                <div class="clear-both" />

                                <p:outputLabel value="Nome da mãe:" styleClass="grid_5" for="nomeMae"/>
                                <p:inputText id="nomeMae" styleClass="grid_18" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.nomeMae}" />
                                <div class="clear-both" />

                                <p:outputLabel value="Nacionalidade:" styleClass="grid_5" for="nacionalidade"/>
                                <div class="grid_7 selectOneMenu">
                                    <p:selectOneMenu id="nacionalidade" panelStyle="width:150px;" 
                                                     value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.nacionalidade}">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.nacionalidade}"/>
                                    </p:selectOneMenu>
                                </div>

                                <p:outputLabel value="País de nascimento:" styleClass="grid_5" for="paisNascimento"/>
                                <p:inputText id="paisNascimento" styleClass="grid_6" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.paisNascimento}" />
                                <div class="clear-both" />

                                <p:outputLabel value="Telefone celular:" styleClass="grid_5" for="telefoneCelular"/>
                                <p:inputMask id="telefoneCelular" styleClass="grid_5" 
                                             mask="(99) 9999-9999" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.telefone}" />

                                <p:outputLabel value="E-mail:" styleClass="grid_3 alpha" for="email"/>
                                <p:inputText id="email" styleClass="grid_10" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.email}" />
                                <div class="clear-both" />

                                <p:outputLabel value="Município de nascimento:" styleClass="grid_5" for="municipioUf"/>
                                <p:autoComplete id="municipioUf" styleClass="autocompleteMunicipio grid_1" dropdown="true" converter="cidadeconverter"
                                                var="cidade" itemLabel="#{cidade.nome.toString().concat(' - ').concat(cidade.estado.sigla)}"
                                                itemValue="#{cidade}" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.municipioNascimento}"
                                                scrollHeight="200" forceSelection="true" requiredMessage="O campo cidade é obrigatório"
                                                completeMethod="#{managerEditarCadastroIndividual.autocompleteCidade}"/>
                            </p:panel>
                        </fieldset>
                    </p:tab>

                    <p:tab id="tab1" title="Soociodemografico">

                        <h4 class="title">Informações Sociodemográficas</h4>
                        <p:panel id="sociodemograficoPanel" styleClass="container_24 clearfix withoutBorder">

                            <fieldset>
                                <legend>Situação conjugal</legend>                        
                                <p:selectOneRadio id="situacaoConjugal" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.situacaoConjugal}">
                                    <f:selectItems value="#{managerUtilitario.situacaoConjugal}"/>
                                </p:selectOneRadio>
                            </fieldset>

                            <fieldset>
                                <legend>Ocupação</legend>
                                <p:outputLabel value="Profissão:" styleClass="grid_3" for="profissao"/>
                                <p:inputText id="profissao" styleClass="grid_17" value="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.ocupacao}" />
                            </fieldset>
                        </p:panel>

                        <p:panel id="escolaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Frequenta a escola?</legend>
                                <p:selectOneRadio id="frequentaEscola" value="#{managerEditarCadastroIndividual.cadastroEditar.frequentaEscola}">
                                    <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    <p:ajax update=":form:tabView:escolaPanel"/>
                                </p:selectOneRadio>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.frequentaEscola ? '' : 'display: none'}">

                                    <fieldset>
                                        <legend>Qual é o curso mais elevado que frequenta ou frequentou?</legend>
                                        <div class="grid_20">
                                            <p:selectOneMenu panelStyle="width:150px;" value="#{managerEditarCadastroIndividual.cadastroEditar.tipoCurso}">
                                                <f:selectItem itemValue="" itemLabel=""/>
                                                <f:selectItems value="#{managerUtilitario.tipoCurso}"/>
                                            </p:selectOneMenu>
                                        </div>
                                    </fieldset>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="mercadoTrabalhoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Situação no mercado de trabalho</legend>
                                <div class="grid_20">
                                    <p:selectOneMenu panelStyle="width:150px;" value="#{managerEditarCadastroIndividual.cadastroEditar.situacaoMercadoTrabalho}">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.situacaoMercadoTrabalho}"/>
                                    </p:selectOneMenu>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="curandeiroPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Frequenta curandeiro(a) / benzedeiro(a)?</legend>
                                <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.frequentaCurandeiro}">
                                    <f:selectItems value="#{managerUtilitario.simNao}"/>
                                </p:selectOneRadio>
                            </fieldset>
                        </p:panel>

                        <p:panel id="planoSaudePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Possui plano de saúde privado?</legend>
                                <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.planoSaudePrivado}">
                                    <f:selectItems value="#{managerUtilitario.simNao}"/>
                                </p:selectOneRadio>
                            </fieldset>
                        </p:panel>

                        <p:panel id="membroComunidadePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>É membro de povo ou comunidade tradicional?</legend>
                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.membroComunidade}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:membroComunidadePanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.membroComunidade ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6" for="qualComunidade"/>
                                    <p:inputText id="qualComunidade" styleClass="grid_10"
                                                 value="#{managerEditarCadastroIndividual.cadastroEditar.nomeComunidade}"/>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="orientacaoSexualPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Deseja informar orientação sexual / identidade de gênero?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.informarOrientacaoSexual}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:orientacaoSexualPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.informarOrientacaoSexual ? '' : 'display: none'}">

                                    <p:outputLabel value="Qual?" styleClass="grid_6"/>
                                    <div class="grid_10">
                                        <p:selectOneMenu panelStyle="width: 150px"
                                                         value="#{managerEditarCadastroIndividual.cadastroEditar.orientacaoSexual}">
                                            <f:selectItem itemValue="" itemLabel=""/>
                                            <f:selectItems value="#{managerUtilitario.orientacaoSexual}"/>
                                        </p:selectOneMenu>
                                    </div>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="deficienciaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem alguma deficiêcia?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.possuiDeficiencia}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:deficienciaPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.possuiDeficiencia ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6"/>
                                    <div class="grid_5">
                                        <p:selectManyCheckbox converter="tipodeficienciaconverter" 
                                                              layout="grid" columns="3" styleClass="withoutBorder"
                                                              value="#{managerEditarCadastroIndividual.cadastroEditar.tipoDeficiencia}">
                                            <f:selectItems value="#{managerUtilitario.tipoDeficiencia}" />
                                        </p:selectManyCheckbox>
                                    </div>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="situacaoRuaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Situação de rua?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.situacaoDeRua}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:situacaoRuaPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.situacaoDeRua ? '' : 'display: none'}">
                                    <p:outputLabel value="Tempo:" styleClass="grid_6"/>
                                    <div class="grid_10">
                                        <p:selectOneMenu panelStyle="width: 150px"
                                                         value="#{managerEditarCadastroIndividual.cadastroEditar.tempoSituacaoRua}">
                                            <f:selectItem itemValue="" itemLabel=""/>
                                            <f:selectItems value="#{managerUtilitario.tempoSituacaoRua}"/>
                                        </p:selectOneMenu>
                                    </div>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="outraInstituicaoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>É acompanhado por outra instituição?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.acompanhadoOutraInstituicao}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:outraInstituicaoPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.acompanhadoOutraInstituicao ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6" for="outraInstituicao"/>
                                    <p:inputText id="outraInstituicao" styleClass="grid_10"
                                                 value="#{managerEditarCadastroIndividual.cadastroEditar.nomeOutraInstituicao}"/>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="beneficioPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Recebe algum benefício?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.recebeAlgumBeneficio}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="referenciaFamiliarPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Possui referencia familiar?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.possuiReferenciaFamiliar}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="visitaFamiliarPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Visita algum familiar com frequência?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.cadastroEditar.frequentaFamiliarFrequencia}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:visitaFamiliarPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.cadastroEditar.frequentaFamiliarFrequencia ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6"/>
                                    <div class="grid_10">
                                        <p:selectOneMenu panelStyle="width: 150px"
                                                         value="#{managerEditarCadastroIndividual.cadastroEditar.grauParentesco}">
                                            <f:selectItem itemValue="" itemLabel=""/>
                                            <f:selectItems value="#{managerUtilitario.grauParentesco}"/>
                                        </p:selectOneMenu>
                                    </div>
                                </div>
                            </fieldset>
                        </p:panel>
                        <div class="clear-both"/>
                    </p:tab>

                    <p:tab id="tab2" title="Questionário">

                        <h5 class="title">QUESTIONÁRIO AUTO-REFERIDO DE CONDIÇÕES / SITUAÇÕES DE SAÚDE</h5>
                        <h4 class="title">Condições / situações de saúde gerais</h4>

                        <p:panel id="gestantePuerperioPanel" styleClass="container_24 clearfix withoutBorder" style="padding: 0">

                            <p:panel id="pccuPanel" styleClass="container_24 clearfix withoutBorder"
                                     style="width: 104%; margin-left: -16px"
                                     rendered="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.sexo eq 'FEMININO'}">
                                <fieldset>
                                    <legend>PCCU - PAPANICOLAU OU PREVENTIVO DO COLO UTERINO?</legend>

                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.pccu}" styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:pccuPanel"/>
                                        </p:selectOneRadio>
                                    </div>

                                    <div style="#{managerEditarCadastroIndividual.questionarioEditar.pccu ? '' : 'display: none'}">
                                        <div class="clear-both"/>
                                        <br/>

                                        <p:outputLabel value="Faz anualmente?" styleClass="grid_8"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.pccuFazAnualmente}">
                                                <f:selectItems value="#{managerUtilitario.simNao}" />
                                            </p:selectOneRadio>
                                        </div>
                                        <div class="clear-both"/>

                                        <p:outputLabel value="Há quanto tempo?" styleClass="grid_8" for="pccuQuantoTempo"/>
                                        <p:inputText id="pccuQuantoTempo" styleClass="grid_8" 
                                                     value="#{managerEditarCadastroIndividual.questionarioEditar.pccuQuantoTempo}" />
                                    </div>

                                </fieldset>
                            </p:panel>

                            <p:panel id="gestantePanel" styleClass="container_24 clearfix withoutBorder"
                                     style="width: 104%; margin-left: -16px"
                                     rendered="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.sexo eq 'FEMININO'}">
                                <fieldset>
                                    <legend>Está gestante?</legend>

                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.gestante}" styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:gestantePanel, :form:tabView:puerperioPanel"/>
                                        </p:selectOneRadio>
                                    </div>

                                    <div style="#{managerEditarCadastroIndividual.questionarioEditar.gestante ? '' : 'display: none'}">
                                        <div class="clear-both"/>
                                        <br/>
                                        <p:outputLabel value="DUM:" styleClass="grid_3" for="dum" />
                                        <p:calendar id="dum" styleClass="grid_5"
                                                    showOn="both" locale="pt" yearRange="1900:2020" 
                                                    navigator="true" pattern="dd/MM/yyyy"
                                                    value="#{managerEditarCadastroIndividual.questionarioEditar.gestanteDUM}" />

                                        <p:outputLabel value="Exames em dia?" styleClass="grid_8"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.gestanteExamesEmDia}">
                                                <f:selectItems value="#{managerUtilitario.simNao}" />
                                            </p:selectOneRadio>
                                        </div>
                                        <div class="clear-both"/>

                                        <p:outputLabel value="DPP:" styleClass="grid_3" for="dpp" />
                                        <p:calendar id="dpp" styleClass="grid_5"
                                                    showOn="both" locale="pt" yearRange="1900:2020" 
                                                    navigator="true" pattern="dd/MM/yyyy"
                                                    value="#{managerEditarCadastroIndividual.questionarioEditar.gestanteDPP}" />

                                        <p:outputLabel value="Trimestre da gestação:" styleClass="grid_8"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.gestanteQualTrimestre}">
                                                <f:selectItems value="#{managerUtilitario.trimestreGestacao}" />
                                            </p:selectOneRadio>
                                        </div>
                                        <div class="clear-both"/><br/>

                                        <p:outputLabel value="Acompanhamento pré-natal?" styleClass="grid_7"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.gestanteAcompanhamentoPreNatal}">
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                        <div class="clear-both"/><br/>
                                        <p:outputLabel value="Gravidez menor de 20 anos?" styleClass="grid_7"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.gestanteGravidezMenorVinteAnos}">
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                    </div>

                                </fieldset>
                            </p:panel>

                            <p:panel id="puerperioPanel" styleClass="container_24 clearfix withoutBorder"
                                     style="width: 104%; margin-left: -16px"
                                     rendered="#{managerEditarCadastroIndividual.cadastroEditar.cidadao.sexo eq 'FEMININO'}">

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.gestante eq false ? '' : 'display: none'}">
                                    <legend>Puerpério?</legend>

                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.puerperio}" styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:puerperioPanel"/>
                                        </p:selectOneRadio>
                                    </div>
                                    <div class="clear-both"/>

                                    <div style="#{managerEditarCadastroIndividual.questionarioEditar.puerperio ? '' : 'display: none'}">
                                        <br/>
                                        <p:outputLabel value="RN com peso menor que 2,5kg?" styleClass="grid_8"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.puerperioRNPeso}">
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                        <div class="clear-both"/><br/>

                                        <p:outputLabel value="Aleitamento exclusivo?" styleClass="grid_8"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.puerperioExclusivo}">
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                        <div class="clear-both"/><br/>

                                        <p:outputLabel value="Aleitamento misto?" styleClass="grid_8"/>
                                        <div class="grid_2" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.puerperioMisto}">
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                    </div>

                                </fieldset>
                            </p:panel>
                        </p:panel>

                        <p:panel id="pesoPanel" styleClass="container_24 clearfix withoutBorder">

                            <fieldset>
                                <legend>Sobre seu peso, você se considera?</legend>

                                <div class="grid_20">
                                    <p:selectOneMenu value="#{managerEditarCadastroIndividual.questionarioEditar.peso}" 
                                                     panelStyle="width: 150px">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.peso}"/>
                                    </p:selectOneMenu>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="fumantePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está fumante?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.fumante}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:fumantePanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.fumante ? '' : 'display: none'}">
                                    <p:outputLabel value="Há quanto tempo?" styleClass="grid_8" for="fumanteQuantoTempo"/>
                                    <p:inputText id="fumanteQuantoTempo" styleClass="grid_8" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.fumanteQuantoTempo}" />
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="alcoolPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está dependente ou abusa de álcool?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.dependenteAlcoolico}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:alcoolPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.dependenteAlcoolico ? '' : 'display: none'}">
                                    <p:outputLabel value="Há quanto tempo?" styleClass="grid_8" for="dependenteAlcoolicoQuantoTempo"/>
                                    <p:inputText id="dependenteAlcoolicoQuantoTempo" styleClass="grid_8" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.dependenteAlcoolicoQuantoTempo}" />
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="drogasPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está dependente ou abusa de outras drogas?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.dependenteDrogas}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="hipertensaoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem hipertensão arterial?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.hipertensao}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:hipertensaoPanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.hipertensao ? '' : 'display: none'}">
                                    <legend>Usa medicamento?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.hipertensaoUsaMedicamento}" styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:hipertensaoPanel"/>
                                        </p:selectOneRadio>
                                    </div>

                                    <div style="#{managerEditarCadastroIndividual.questionarioEditar.hipertensaoUsaMedicamento ? '' : 'display: none'}">
                                        <p:outputLabel value="Qual?" styleClass="grid_5" for="hipertensaoNomeMedicamento"/>
                                        <p:inputText id="hipertensaoNomeMedicamento" styleClass="grid_11" 
                                                     value="#{managerEditarCadastroIndividual.questionarioEditar.hipertensaoNomeMedicamento}" />
                                    </div>

                                </fieldset>
                            </fieldset>
                        </p:panel>

                        <p:panel id="diabetesPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem diabetes?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.diabetes}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:diabetesPanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.diabetes ? '' : 'display: none'}">
                                    <legend>Usa medicamento?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.diabetesUsaMedicamento}" styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:diabetesPanel"/>
                                        </p:selectOneRadio>
                                    </div>

                                    <div style="#{managerEditarCadastroIndividual.questionarioEditar.diabetesUsaMedicamento ? '' : 'display: none'}">
                                        <p:outputLabel value="Qual?" styleClass="grid_5" for="diabetesNomeMedicamento"/>
                                        <p:inputText id="diabetesNomeMedicamento" styleClass="grid_11" 
                                                     value="#{managerEditarCadastroIndividual.questionarioEditar.diabetesNomeMedicamento}" />
                                    </div>

                                </fieldset>
                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.diabetes ? '' : 'display: none'}">
                                    <legend>Hospitalização por complicação?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.diabetesHospitalizacaoPorComplicacao}" styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        </p:selectOneRadio>
                                    </div>
                                </fieldset>
                            </fieldset>
                        </p:panel>

                        <p:panel id="derrameAvcPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Teve AVC / derrame?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.avc}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="infartoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Teve infarto?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.infarto}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="doencaCardiacaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem doença cardíaca / do coração?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.possuiDoencaCardiaca}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:doencaCardiacaPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.possuiDoencaCardiaca ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6"/>
                                    <div class="grid_10">
                                        <p:selectManyCheckbox converter="doencacardiacaconverter" 
                                                              layout="grid" columns="2" styleClass="withoutBorder"
                                                              value="#{managerEditarCadastroIndividual.questionarioEditar.doencaCardiaca}">

                                            <f:selectItems value="#{managerUtilitario.doencaCardiaca}" />
                                        </p:selectManyCheckbox>
                                    </div>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="problemaRenalPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem ou teve problemas nos rins?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.possuiProblemaRenal}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:problemaRenalPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.possuiProblemaRenal ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6"/>
                                    <div class="grid_10">
                                        <p:selectManyCheckbox converter="problemarenalconverter"
                                                              layout="grid" columns="2" styleClass="withoutBorder"
                                                              value="#{managerEditarCadastroIndividual.questionarioEditar.problemaRenal}" >

                                            <f:selectItems value="#{managerUtilitario.problemaRenal}"/>
                                        </p:selectManyCheckbox>
                                    </div>
                                    <div class="clear-both"/>

                                    <p:outputLabel value="Qual medicação?" styleClass="grid_5" for="problemaRenalNomeMedicacao"/>
                                    <p:inputText id="problemaRenalNomeMedicacao" styleClass="grid_6" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.problemaRenalNomeMedicacao}"/>

                                    <p:outputLabel value="Há quanto tempo?" styleClass="grid_5" for="problemaRenalQuantoTempo"/>
                                    <p:inputText id="problemaRenalQuantoTempo" styleClass="grid_5" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.problemaRenalQuantoTempo}"/>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="doencaPulmonarPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem doença respiratoria / no pulmão?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.possuiDoencaPulmonar}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:doencaPulmonarPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.possuiDoencaPulmonar ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_6"/>
                                    <div class="grid_10">
                                        <p:selectManyCheckbox value="#{managerEditarCadastroIndividual.questionarioEditar.doencaPulmonar}"
                                                              converter="doencapulmonarconverter"
                                                              layout="grid" columns="2" styleClass="withoutBorder">
                                            <f:selectItems value="#{managerUtilitario.doencaPulmonar}"/>
                                        </p:selectManyCheckbox>
                                    </div>
                                    <div class="clear-both"/>
                                    <br/>

                                    <p:outputLabel value="Qual medicação?" styleClass="grid_5" for="doencaPulmonarNomeMedicacao"/>
                                    <p:inputText id="doencaPulmonarNomeMedicacao" styleClass="grid_6" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.doencaPulmonarNomeMedicacao}" />

                                    <p:outputLabel value="Há quanto tempo?" styleClass="grid_5" for="doencaPulmonarQuantoTempo"/>
                                    <p:inputText id="doencaPulmonarQuantoTempo" styleClass="grid_5" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.doencaPulmonarQuantoTempo}" />
                                </div>

                            </fieldset>
                        </p:panel>

                        <p:panel id="hanseniasePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está com hanseníase?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.hanseniase}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:hanseniasePanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.hanseniase ? '' : 'display: none'}">
                                    <legend>Segue em tratamento?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.hanseniaseEmTratamento}" 
                                                          styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:hanseniasePanel"/>
                                        </p:selectOneRadio>
                                    </div>
                                </fieldset>

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.hanseniase and 
                                                   managerEditarCadastroIndividual.questionarioEditar.hanseniaseEmTratamento eq false ? '' : 'display: none'}">
                                    <legend>Está curado?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.hanseniaseCurado}"
                                                          styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        </p:selectOneRadio>
                                    </div>
                                </fieldset>
                            </fieldset>
                        </p:panel>

                        <p:panel id="tuberculosePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está com tuberculose?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.tuberculose}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:tuberculosePanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both" />

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.tuberculose ? '' : 'display: none'}">
                                    <legend>Segue em tratamento?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.tuberculoseEmTratamento}" 
                                                          styleClass="grid_3" >

                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            <p:ajax update=":form:tabView:tuberculosePanel"/>
                                        </p:selectOneRadio>
                                    </div>
                                </fieldset>

                                <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.tuberculose and 
                                                   managerEditarCadastroIndividual.questionarioEditar.tuberculoseEmTratamento eq false ? '' : 'display: none'}">
                                    <legend>Está curado?</legend>
                                    <div class="grid_5" style="margin-top: -10px">
                                        <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.tuberculoseCurado}"
                                                          styleClass="grid_3" >
                                            <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        </p:selectOneRadio>
                                    </div>
                                </fieldset>
                            </fieldset>
                        </p:panel>

                        <p:panel id="cancerPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem ou teve câncer?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.cancer}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:cancerPanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both" />

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.cancer ? '' : 'display: none'}">
                                    <br/>
                                    <p:outputLabel value="Qual?" styleClass="grid_3" for="cancerNome"/>
                                    <p:inputText id="cancerNome" styleClass="grid_6" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.cancerNome}" />

                                    <p:outputLabel value="Há quanto tempo?" styleClass="grid_5" for="cancerQuantoTempo"/>
                                    <p:inputText id="cancerQuantoTempo" styleClass="grid_6" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.cancerQuantoTempo}" />
                                </div>
                                <div class="clear-both" />

                                <p:panel id="cancerTratamentoPanel" styleClass="container_24 clearfix withoutBorder" style="margin: 0; padding: 0">
                                    <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.cancer ? '' : 'display: none'}">
                                        <legend>Segue em tratamento?</legend>
                                        <div class="grid_5" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.cancerEmTratamento}" 
                                                              styleClass="grid_3" >
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                                <p:ajax update=":form:tabView:cancerTratamentoPanel"/>
                                            </p:selectOneRadio>
                                        </div>

                                        <div style="#{managerEditarCadastroIndividual.questionarioEditar.cancerEmTratamento ? '' : 'display: none'}">
                                            <p:outputLabel value="Qual tipo de medicação?" styleClass="grid_9" for="cancerNomeMedicamento"/>
                                            <p:inputText id="cancerNomeMedicamento" styleClass="grid_6" 
                                                         value="#{managerEditarCadastroIndividual.questionarioEditar.cancerNomeMedicamento}" />
                                        </div>
                                    </fieldset>

                                    <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.cancer and
                                                       managerEditarCadastroIndividual.questionarioEditar.cancerEmTratamento eq false ? '' : 'display: none'}">
                                        <legend>Está curado?</legend>
                                        <div class="grid_5" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.cancerCurado}" 
                                                              styleClass="grid_3" >
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                    </fieldset>
                                </p:panel>

                            </fieldset>
                        </p:panel>

                        <p:panel id="dstAidsPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Já teve DST's / AIDS?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.dstsAids}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:dstAidsPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.dstsAids ? '' : 'display: none'}">
                                    <p:outputLabel value="Qual?" styleClass="grid_8" for="dstsAidsNome"/>
                                    <p:inputText id="dstsAidsNome" styleClass="grid_8" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.dstsAidsNome}"/>
                                </div>
                                <div class="clear-both"/>

                                <p:panel id="dstAidsTratamentoPanel" styleClass="container_24 clearfix withoutBorder">
                                    <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.dstsAids ? '' : 'display: none'}">
                                        <legend>Segue em tratamento?</legend>
                                        <div class="grid_5" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.dstsAidsEmTratamento}" 
                                                              styleClass="grid_3" >
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                                <p:ajax update=":form:tabView:dstAidsTratamentoPanel"/>
                                            </p:selectOneRadio>
                                        </div>

                                        <div style="#{managerEditarCadastroIndividual.questionarioEditar.dstsAidsEmTratamento ? '' : 'display: none'}">
                                            <p:outputLabel value="Qual medicamento?" styleClass="grid_8" for="dstsAidsNomeMedicamento"/>
                                            <p:inputText id="dstsAidsNomeMedicamento" styleClass="grid_8" 
                                                         value="#{managerEditarCadastroIndividual.questionarioEditar.dstsAidsNomeMedicamento}"/>
                                        </div>
                                    </fieldset>

                                    <fieldset style="#{managerEditarCadastroIndividual.questionarioEditar.dstsAids and 
                                                       managerEditarCadastroIndividual.questionarioEditar.dstsAidsEmTratamento eq false ? '' : 'display: none'}">
                                        <legend>Está curado?</legend>
                                        <div class="grid_5" style="margin-top: -10px">
                                            <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.dstsAidsCurado}"
                                                              styleClass="grid_3" >
                                                <f:selectItems value="#{managerUtilitario.simNao}"/>
                                            </p:selectOneRadio>
                                        </div>
                                    </fieldset>
                                </p:panel>

                            </fieldset>
                        </p:panel>

                        <p:panel id="internacaoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Teve alguma internação nos últimos 12 meses?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.internadoRecentemente}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:internacaoPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.internadoRecentemente ? '' : 'display: none'}">
                                    <p:outputLabel value="Causa:" styleClass="grid_6" for="causaInternacaoRecente"/>
                                    <p:inputText id="causaInternacaoRecente" styleClass="grid_10" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.causaInternacaoRecente}"/>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="tratamentoPsiquiatricoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Fez ou faz tratamento com psiquiatra ou teve internação por problema de saúde mental?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.tratamentoPsiquiatrico}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="acamadoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está acamado?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.acamado}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:acamadoPanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.acamado ? '' : 'display: none'}">
                                    <br/>
                                    <p:outputLabel value="Há quanto tempo?" styleClass="grid_5" for="acamadoQuantoTempo"/>
                                    <p:inputText id="acamadoQuantoTempo" styleClass="grid_5" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.acamadoQuantoTempo}" />

                                    <p:outputLabel value="Qual motivo?" styleClass="grid_5" for="acamadoMotivo"/>
                                    <p:inputText id="acamadoMotivo" styleClass="grid_6" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.acamadoMotivo}" />
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="domiciliadoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Está domiciliado?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.domiciliado}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="plantasMedicinaisPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Usa plantas medicinais?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.usaPlantasMedicinais}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:plantasMedicinaisPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.usaPlantasMedicinais ? '' : 'display: none'}">
                                    <p:outputLabel value="Quais?" styleClass="grid_6" for="nomePlantasMedicinais"/>
                                    <p:inputText id="nomePlantasMedicinais" styleClass="grid_10" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.nomePlantasMedicinais}"/>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="praticasIntegradasPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Usa outras práticas integradas e complementares?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.outrasPraticasIntegrativas}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:praticasIntegradasPanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.outrasPraticasIntegrativas ? '' : 'display: none'}">
                                    <br/>

                                    <p:outputLabel value="Prática:" styleClass="grid_3" for="praticaInputText"/>
                                    <p:inputText id="praticaInputText" styleClass="grid_10" 
                                                 value="#{managerEditarCadastroIndividual.pratica}"/>

                                    <div class="buttonAction">
                                        <p:commandButton value="Adicionar" icon="ui-icon-circle-plus" 
                                                         process=":form:tabView:praticasIntegradasPanel"
                                                         update=":form:tabView:praticasIntegradasPanel"
                                                         actionListener="#{managerEditarCadastroIndividual.adicionarPratica()}"
                                                         styleClass="ui-priority-primary" />
                                    </div><br/>

                                    <p:dataTable id="praticasTable" var="item" 
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.outrasPraticasIntegrativasNome}" 
                                                 styleClass="grid_24" emptyMessage="Nenhum registro" rowIndexVar="idpratica">  
                                        <f:facet name="header">
                                            Outras Práticas
                                        </f:facet>

                                        <p:column headerText="Ação" width="100" style="vertical-align: middle; text-align: center">
                                            <p:commandButton title="Editar" update=":form:tabView:praticasIntegradasPanel" 
                                                             process=":form:tabView:praticasIntegradasPanel"
                                                             actionListener="#{managerEditarCadastroIndividual.editarPratica(item)}"
                                                             icon="ui-icon-pencil"/>
                                            <p:commandButton title="Remover" update=":form:tabView:praticasIntegradasPanel" 
                                                             process=":form:tabView:praticasIntegradasPanel"
                                                             actionListener="#{managerEditarCadastroIndividual.removerPratica(item)}"
                                                             icon="ui-icon-trash"/>
                                        </p:column>

                                        <p:column headerText="Nome" style="vertical-align: middle; text-align: center">
                                            <h:outputText value="#{item}"/>
                                        </p:column>
                                    </p:dataTable>

                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="condicaoSaudePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Outras condições de saúde?</legend>

                                <p:outputLabel value="Condição:" styleClass="grid_3" for="condicao"/>
                                <p:inputText id="condicao" styleClass="grid_18" value="#{managerEditarCadastroIndividual.condicaoSaude}"/>
                                <div class="buttonAction">
                                    <p:commandButton value="Adicionar" icon="ui-icon-circle-plus" 
                                                     process=":form:tabView:condicaoSaudePanel"
                                                     update=":form:tabView:condicaoSaudePanel"
                                                     actionListener="#{managerEditarCadastroIndividual.adicionarCondicao()}"
                                                     styleClass="ui-priority-primary" />
                                </div><br/>

                                <p:dataTable id="condicaoTable" var="item" 
                                             value="#{managerEditarCadastroIndividual.questionarioEditar.outrasCondicoesSaude}" 
                                             styleClass="grid_24" emptyMessage="Nenhum registro" rowIndexVar="idcondicao">  
                                    <f:facet name="header">
                                        Outras Condições de Saúde
                                    </f:facet>

                                    <p:column headerText="Ação" width="100" style="vertical-align: middle; text-align: center">
                                        <p:commandButton title="Editar" update=":form:tabView:condicaoSaudePanel" 
                                                         process=":form:tabView:condicaoSaudePanel"
                                                         actionListener="#{managerEditarCadastroIndividual.editarCondicao(item)}"
                                                         icon="ui-icon-pencil"/>
                                        <p:commandButton title="Remover" update=":form:tabView:condicaoSaudePanel" 
                                                         process=":form:tabView:condicaoSaudePanel"
                                                         actionListener="#{managerEditarCadastroIndividual.removerCondicao(item)}"
                                                         icon="ui-icon-trash"/>
                                    </p:column>

                                    <p:column headerText="Nome" style="vertical-align: middle; text-align: center">
                                        <h:outputText value="#{item}"/>
                                    </p:column>
                                </p:dataTable>

                            </fieldset>
                        </p:panel>

                    </p:tab> 

                    <p:tab id="tab3" title="Em situacao de rua">
                        <h5 class="title">Situação de rua</h5>

                        <p:panel id="situacaoDeRuaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Quantas vezes se alimenta ao dia?</legend>

                                <div class="grid_16">
                                    <p:selectOneMenu panelStyle="width: 150px"
                                                     value="#{managerEditarCadastroIndividual.questionarioEditar.alimentacaoDiaria}">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.alimentacaoDiaria}"/>
                                    </p:selectOneMenu>
                                </div>
                            </fieldset>

                            <fieldset>
                                <legend>Qual a origem da alimentação?</legend>
                                <div class="grid_23" style="margin-top: -7px">
                                    <p:selectManyCheckbox value="#{managerEditarCadastroIndividual.questionarioEditar.origemAlimentacao}" 
                                                          converter="origemalimentacaoconverter"
                                                          layout="grid" columns="3" styleClass="withoutBorder">
                                        <f:selectItems value="#{managerUtilitario.origemAlimentacao}"/>
                                    </p:selectManyCheckbox>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="acessoHigienePanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Tem acesso a higiene pessoal?</legend>

                                <div class="grid_5" style="margin-top: -10px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.acessoHigienePessoal}" styleClass="grid_3" >
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:acessoHigienePanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.acessoHigienePessoal ? '' : 'display: none'}">
                                    <fieldset>
                                        <legend>Higiene Pessoal</legend>
                                        <div class="grid_23" style="margin-top: -7px">
                                            <p:selectManyCheckbox value="#{managerEditarCadastroIndividual.questionarioEditar.higienePessoal}" 
                                                                  converter="higienepessoalconverter" styleClass="withoutBorder">
                                                <f:selectItems value="#{managerUtilitario.higienePessoal}"/>
                                            </p:selectManyCheckbox>
                                        </div>
                                    </fieldset>
                                </div>

                            </fieldset>

                        </p:panel>
                    </p:tab>

                    <p:tab id="tab4" title="Bolsa Família">

                        <h5 class="title">CRIANÇA</h5>

                        <p:panel id="criancasPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Crianças de 0 a 9 anos, com quem fica?</legend>
                                <div class="grid_20">
                                    <p:selectOneMenu panelStyle="width:150px;" value="#{managerEditarCadastroIndividual.cadastroEditar.responsavelCrianca}">
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{managerUtilitario.responsavelCrianca}"/>
                                    </p:selectOneMenu>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="criancaPesoPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Pesada?</legend>
                                <div class="grid_5" style="margin-top: -7px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.criancaPesada}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                            </fieldset>
                        </p:panel>

                        <p:panel id="criancaDesnutridaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Desnutrida?</legend>
                                <div class="grid_5" style="margin-top: -7px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.criancaDesnutrida}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                    </p:selectOneRadio>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="criancaDiarreiaPanel" styleClass="container_24 clearfix withoutBorder">
                            <fieldset>
                                <legend>Diarréia?</legend>
                                <div class="grid_5" style="margin-top: -7px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.criancaDiarreia}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:criancaDiarreiaPanel"/>
                                    </p:selectOneRadio>
                                </div>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.criancaDiarreia ? '' : 'display: none'}">
                                    <div class="clear-both"/><br/>

                                    <p:outputLabel value="Qual Tratamento?" styleClass="grid_6" for="criancaDiarreiaTratamento"/>
                                    <p:inputText id="criancaDiarreiaTratamento" styleClass="grid_12"
                                                 value="#{managerEditarCadastroIndividual.questionarioEditar.criancaDiarreiaTratamento}"/>
                                </div>
                            </fieldset>
                        </p:panel>

                        <p:panel id="criancaVacinaPanel" styleClass="container_24 clearfix withoutBorder">

                            <fieldset>
                                <legend>Vacinação em dia?</legend>
                                <div class="grid_5" style="margin-top: -7px">
                                    <p:selectOneRadio value="#{managerEditarCadastroIndividual.questionarioEditar.criancaVacinada}">
                                        <f:selectItems value="#{managerUtilitario.simNao}"/>
                                        <p:ajax update=":form:tabView:criancaVacinaPanel"/>
                                    </p:selectOneRadio>
                                </div>
                                <div class="clear-both"/>

                                <div style="#{managerEditarCadastroIndividual.questionarioEditar.criancaVacinada eq false ? '' : 'display: none'}">
                                    <fieldset>
                                        <legend>Quais não foram aplicadas?</legend>
                                        <p:outputLabel value="Vacina:" styleClass="grid_3" for="vacinaAutoComplete"/>
                                        <p:autoComplete id="vacinaAutoComplete" styleClass="grid_19"
                                                        forceSelection="true" scrollHeight="200"
                                                        converter="vacinaconverter" dropdown="true"
                                                        var="v" itemValue="#{v}" itemLabel="#{v.nome}"
                                                        completeMethod="#{managerEditarCadastroIndividual.autocompleteVacina}"
                                                        value="#{managerEditarCadastroIndividual.vacina}"/>
                                        <div class="clear-both"/>

                                        <div class="buttonAction">
                                            <p:commandButton icon="ui-icon-circle-plus" value="Adicionar"
                                                             process=":form:tabView:criancaVacinaPanel"
                                                             update=":form:tabView:criancaVacinaPanel"
                                                             actionListener="#{managerEditarCadastroIndividual.adicionarVacina()}"/>
                                        </div><br/>

                                        <p:dataTable id="vacinasTable" var="vacina" 
                                                     value="#{managerEditarCadastroIndividual.questionarioEditar.criancaVacinasAtrasadas}" 
                                                     paginatorPosition="bottom" paginator="true" rows="5"
                                                     styleClass="grid_24" emptyMessage="Nenhum registro" rowIndexVar="idVacina">  
                                            <f:facet name="header">
                                                Vacinas
                                            </f:facet>

                                            <p:column headerText="Ação" width="50" style="vertical-align: middle; text-align: center">
                                                <p:commandButton title="Remover" update=":form:tabView:criancaVacinaPanel" 
                                                                 process=":form:tabView:criancaVacinaPanel"
                                                                 actionListener="#{managerEditarCadastroIndividual.removerVacina(vacina)}"
                                                                 icon="ui-icon-trash"/>
                                            </p:column>

                                            <p:column headerText="Nome" style="vertical-align: middle; text-align: center">
                                                <h:outputText value="#{vacina.nome}"/>
                                            </p:column>
                                        </p:dataTable>
                                    </fieldset>
                                </div>
                                <div class="clear-both"/>
                            </fieldset>
                        </p:panel>

                        <p:panel styleClass="container_24 clearfix withoutBorder">

                            <fieldset>
                                <legend>Medidas</legend>

                                <p:outputLabel value="Idade:" styleClass="grid_3" for="idadeInputText"/>
                                <p:inputText id="idadeInputText" styleClass="grid_4" 
                                             onkeypress="jQuery(this).autoNumeric({aSign:' ano(s)', aSep: '.', aDec: '.', pSign:'s', mDec:'0'} );"
                                             value="#{managerEditarCadastroIndividual.questionarioEditar.criancaIdade}">
                                    <f:convertNumber locale="pt,BR"/>
                                </p:inputText>

                                <p:outputLabel value="Peso:" styleClass="grid_3" for="pesoInputText"/>
                                <p:inputText id="pesoInputText" styleClass="grid_4" 
                                             onkeypress="jQuery(this).autoNumeric({aSign:' Kg', aSep: '.', aDec: ',', pSign:'s', mDec:'3'} );"
                                             value="#{managerEditarCadastroIndividual.questionarioEditar.criancaPeso}">
                                    <f:convertNumber locale="pt,BR"/>
                                </p:inputText>

                                <p:outputLabel value="Altura:" styleClass="grid_3" for="alturaInputText"/>
                                <p:inputText id="alturaInputText" styleClass="grid_4" 
                                             onkeypress="jQuery(this).autoNumeric({aSign:' m', aSep: '.', aDec: ',', pSign:'s'} );"
                                             value="#{managerEditarCadastroIndividual.questionarioEditar.criancaAltura}">
                                    <f:convertNumber locale="pt,BR"/>
                                </p:inputText>
                                <div class="clear-both"/>
                            </fieldset>

                            <fieldset>
                                <legend>Tipo de Alimentação</legend>

                                <div class="grid_22" style="margin-top: -7px">
                                    <p:selectOneMenu value="#{managerEditarCadastroIndividual.questionarioEditar.criancaTipoAlimentacao}">
                                        <f:selectItem itemLabel="" itemValue=""/>
                                        <f:selectItems value="#{managerUtilitario.tipoAlimentacao}"/>
                                    </p:selectOneMenu>
                                </div>
                            </fieldset>

                            <fieldset>
                                <legend>Doença</legend>

                                <div class="grid_23" style="margin-top: -7px">
                                    <p:selectManyCheckbox value="#{managerEditarCadastroIndividual.questionarioEditar.criancaDoencas}" 
                                                          converter="doencaconverter"
                                                          layout="grid" columns="3" styleClass="withoutBorder">
                                        <f:selectItems value="#{managerUtilitario.doencas}"/>
                                    </p:selectManyCheckbox>
                                </div>
                            </fieldset>

                            <fieldset>
                                <legend>Intercorrência</legend>

                                <div class="grid_23" style="margin-top: -7px">
                                    <p:selectManyCheckbox value="#{managerEditarCadastroIndividual.questionarioEditar.criancaIntercorrencias}" 
                                                          converter="intercorrenciaconverter"
                                                          layout="grid" columns="2" styleClass="withoutBorder">
                                        <f:selectItems value="#{managerUtilitario.intercorrencias}"/>
                                    </p:selectManyCheckbox>
                                </div>
                            </fieldset>

                        </p:panel>
                    </p:tab>

                </p:tabView>
                <div class="clear"/>

                <div class="buttonAction">
                    <p:commandButton id="bt_salvar" value="Salvar" icon="ui-icon-disk"
                                     update="@form, :dialogForm, :dialogResponsavelForm" 
                                     action="#{managerEditarCadastroIndividual.atualizar()}"
                                     styleClass="ui-priority-primary" />
                    <p:button href="index.xhtml" value="Cancelar" icon="ui-icon-trash" />
                </div>

            </h:form>

            <p:dialog id="profissionalDialog" widgetVar="dialogProfissional" header="Profissional" dynamic="true"
                      modal="true" appendToBody="false" resizable="false" width="1024px" height="450px" draggable="true" closable="false">
                <h:form id="dialogForm">
                    <p:tabView id="profissionalTabView">

                        <p:tab id="pesquisarProfissionalTab" title="Pesquisar Profissional">

                            <p:panel id="profissionalPesquisarPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix both ">
                                <h4 class="title">Selecionar Profissional</h4>

                                <p:outputLabel value="Nome:" styleClass="grid_3" for="nomeInputText" />
                                <p:inputText id="nomeInputText" styleClass="grid_19" 
                                             value="#{ managerEditarCadastroIndividual.profissionalPesquisar.nome }" />
                                <div class="clear"/>

                                <p:outputLabel value="CNES:" styleClass="grid_3" for="cnesInputText" />
                                <p:inputText id="cnesInputText" styleClass="grid_8" 
                                             value="#{ managerEditarCadastroIndividual.profissionalPesquisar.codigoCNES }" />

                                <p:outputLabel value="Cartão SUS:" styleClass="grid_3 alpha" for="susInputText" />
                                <p:inputText id="susInputText" styleClass="grid_8"  
                                             value="#{ managerEditarCadastroIndividual.profissionalPesquisar.numeroCartaoSus }" />
                                <div class="clear"/>

                                <div class="buttonAction">
                                    <p:commandButton actionListener="#{ managerEditarCadastroIndividual.pesquisarProfissional() }" value="Pesquisar"
                                                     update=":dialogForm:profissionalTabView:profissionalPesquisarPanel" 
                                                     process=":dialogForm:profissionalTabView:profissionalPesquisarPanel"
                                                     icon="ui-icon-search" />
                                    <p:commandButton value="Cancelar" icon="ui-icon-cancel" oncomplete="dialogProfissional.hide()" 
                                                     process="@this" update="@this" />
                                </div>
                                <br/>

                                <p:dataTable id="profissionaisDataTable" var="item" value="#{ managerEditarCadastroIndividual.profissionaisPesquisar }" 
                                             rows="5" paginator="true" paginatorPosition="bottom" rowKey="#{ item.id }"
                                             selectionMode="single" emptyMessage="Nenhum profissional encontrado"
                                             style="white-space: pre-wrap;" styleClass="grid_24">

                                    <f:facet name="header">Profissional</f:facet>
                                    <p:ajax event="rowSelect" process=":dialogForm:profissionalTabView:profissionaisDataTable" update="@this"/>

                                    <p:column headerText="Ação" width="40">
                                        <p:commandButton update=":form:tabView:cabecalhoPanel" process="@this"
                                                         actionListener="#{managerEditarCadastroIndividual.selecionarProfissional(item)}"
                                                         alt="Selecionar" icon="ui-icon-check" oncomplete="dialogProfissional.hide();" />
                                    </p:column>

                                    <p:column headerText="Número Cartão SUS" width="250">
                                        <h:outputText value="#{ item.numeroCartaoSus }" />
                                    </p:column>

                                    <p:column headerText="Nome">
                                        <h:outputText value="#{ item.nome }" />
                                    </p:column>

                                </p:dataTable>

                            </p:panel>

                        </p:tab>

                        <p:tab id="cadastrarProfissionalTab" title="Cadastrar Profissional">

                            <p:growl id="messages" showDetail="true" autoUpdate="true"  /> 
                            <p:panel id="personPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix both ">
                                <h4 class="title">Dados Gerais</h4>
                                <p:outputLabel value="Nome:" styleClass="grid_3" for="nInputText" />
                                <p:inputText id="nInputText" styleClass="grid_19" required="true" requiredMessage="O Campo nome é Obrigatório" 
                                             value="#{ managerEditarCadastroIndividual.profissionalCadastrar.nome }" />
                                <p:outputLabel value="CNES:" styleClass="grid_3" for="cInputText" />
                                <p:inputText id="cInputText" styleClass="grid_8" required="true" requiredMessage="O Campo cnes é Obrigatório" 
                                             value="#{ managerEditarCadastroIndividual.profissionalCadastrar.codigoCNES }" />
                                <div class="clear"/>
                                <p:outputLabel value="Cartão SUS:" styleClass="grid_3" for="sInputText" />
                                <p:inputText id="sInputText" styleClass="grid_8" required="true" requiredMessage="O Campo Cartão SUS é Obrigatório" 
                                             value="#{ managerEditarCadastroIndividual.profissionalCadastrar.numeroCartaoSus }" />
                                <div class="clear"/>

                                <p:outputLabel value="Tipo Profissional:" styleClass="grid_4"  style="margin-left: -28px" for="tipoOneMenu" />
                                <div class="grid_8 selectOneMenu">
                                    <p:selectOneMenu id="tipoOneMenu" panelStyle="width:250px;"
                                                     value="#{ managerEditarCadastroIndividual.profissionalCadastrar.tipoProfissional }" >
                                        <f:selectItem itemValue="" itemLabel=""/>
                                        <f:selectItems value="#{ managerUtilitario.tipoProfissional() }" />
                                        <p:ajax update=":dialogForm:profissionalTabView:microAreaPanel"/>
                                    </p:selectOneMenu>
                                </div>

                                <p:panel id="microAreaPanel" styleClass="container_24 clearfix withoutBorder" 
                                         style="padding: 0px; margin-left: -12px">
                                    <div class="clear-both"/>

                                    <p:outputLabel value="Micro Área:" styleClass="grid_3" for="microArea"
                                                   rendered="#{ managerEditarCadastroIndividual.profissionalCadastrar.tipoProfissional eq 'AGENTE_SAUDE' }"/>
                                    <p:autoComplete id="microArea" styleClass="grid_20" 
                                                    dropdown="true" converter="microareaconverter"
                                                    var="micro" itemValue="#{micro}" itemLabel="#{micro.nome}"
                                                    value="#{managerEditarCadastroIndividual.profissionalCadastrar.microArea}"
                                                    scrollHeight="200" forceSelection="true" 
                                                    required="true" requiredMessage="O campo cidade é obrigatório"
                                                    rendered="#{ managerEditarCadastroIndividual.profissionalCadastrar.tipoProfissional eq 'AGENTE_SAUDE' }"
                                                    completeMethod="#{managerEditarCadastroIndividual.autocompleteMicroArea}"/>
                                </p:panel>

                            </p:panel>  
                            <p:panel id="docPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix both ">
                                <h4 class="title">Documentos Pessoais</h4>
                                <p:outputLabel value="CPF:" styleClass="grid_3" for="cpfInputText" />
                                <p:inputMask mask="999.999.999-99" id="cpfInputText" styleClass="grid_8" 
                                             value="#{ managerEditarCadastroIndividual.profissionalCadastrar.cpf }" />

                                <p:outputLabel value="Data Nasc.:" styleClass="grid_3" for="dataNascCalendar" />
                                <p:calendar id="dataNascCalendar" styleClass="grid_8"
                                            showOn="both" locale="pt" yearRange="1900:2020" 
                                            navigator="true" pattern="dd/MM/yyyy"
                                            value="#{ managerEditarCadastroIndividual.profissionalCadastrar.dataNascimento }"/>
                                <p:outputLabel value="RG:" styleClass="grid_3" for="rgInputText" />
                                <p:inputText  id="rgInputText" styleClass="grid_8" 
                                              value="#{ managerEditarCadastroIndividual.profissionalCadastrar.rg }" />

                                <p:outputLabel value="Org. Emissor:" styleClass="grid_3" for="emissorInputText" />
                                <p:inputText  id="emissorInputText" styleClass="grid_8" 
                                              value="#{ managerEditarCadastroIndividual.profissionalCadastrar.orgaoEmissor }" />

                                <p:outputLabel value="Pis/Pasep:" styleClass="grid_3" for="pisInputText" />
                                <p:inputText  id="pisInputText" styleClass="grid_8" 
                                              value="#{ managerEditarCadastroIndividual.profissionalCadastrar.pisPasep }" />

                                <p:outputLabel value="Nacionalidade:" styleClass="grid_3" for="nacionalidadeOneMenu" />
                                <div class="grid_8">
                                    <p:selectOneMenu id="nacionalidadeOneMenu" panelStyle="width: 150px"
                                                     value="#{ managerEditarCadastroIndividual.profissionalCadastrar.nacionalidade}" >
                                        <f:selectItems value="#{ managerUtilitario.nacionalidade()}" />
                                    </p:selectOneMenu>
                                </div>
                            </p:panel>

                            <p:panel id="enderecoPanel" styleClass="container_24 clearfix withoutBorder">
                                <h4 class="title">Dados Endereço</h4>

                                <p:outputLabel value="CEP:" styleClass="grid_3" for="cepInputMask" />
                                <p:inputMask id="cepInputMask" styleClass="grid_4" mask="99.999-999" autocomplete="false" 
                                             value="#{managerEditarCadastroIndividual.profissionalCadastrar.endereco.cep}">

                                    <p:ajax event="blur" process="@this" update=":dialogForm:profissionalTabView:enderecoPanel" 
                                            listener="#{managerEditarCadastroIndividual.existeEndereco()}" />
                                </p:inputMask>
                                <p:outputLabel value="* CEP não cadastrado ( Informe o Logradouro, Bairro, Número )" 
                                               rendered="#{managerEditarCadastroIndividual.mensagemEndereco}" 
                                               style="color: red; float: left"  />
                                <div class="clear"/>
                                <p:outputLabel value="Logradouro:" styleClass="grid_3" for="patioInputText" />
                                <p:inputText id="patioInputText" styleClass="grid_19" 
                                             required="true" requiredMessage="O campo Logradouro é Obrigatório"
                                             readonly="#{managerEditarCadastroIndividual.profissionalCadastrar.endereco.id ne null}"
                                             value="#{managerEditarCadastroIndividual.profissionalCadastrar.endereco.logradouro}" />
                                <div class="clear"/>
                                <p:outputLabel value="Bairro:" styleClass="grid_3" for="neighborhoodInputText" />
                                <p:inputText id="neighborhoodInputText" styleClass="grid_19"
                                             required="true" requiredMessage="O campo bairro é Obrigatório"
                                             readonly="#{managerEditarCadastroIndividual.profissionalCadastrar.endereco.id ne null}"
                                             value="#{ managerEditarCadastroIndividual.profissionalCadastrar.endereco.bairro.nome}" />

                                <p:outputLabel value="Número:" styleClass="grid_3" for="numInputText" />
                                <p:inputText id="numInputText" styleClass="grid_4"
                                             value="#{managerEditarCadastroIndividual.profissionalCadastrar.endereco.numero}"/>

                                <p:outputLabel value="Complemento:" styleClass="grid_5 alpha" for="compInputText" />
                                <p:inputText id="compInputText" styleClass="grid_10"
                                             value="#{ managerEditarCadastroIndividual.profissionalCadastrar.endereco.complemento}"/>

                            </p:panel>

                            <br/>
                            <div class="buttonAction">
                                <p:commandButton value="Salvar" icon="ui-icon-disk"
                                                 update="@form, :form:tabView:cabecalhoPanel"
                                                 process="@form" actionListener="#{managerEditarCadastroIndividual.salvarProfissional()}"
                                                 styleClass="ui-priority-primary" />

                                <p:commandButton oncomplete="dialogProfissional.hide()" value="Cancelar" 
                                                 process="@this" icon="ui-icon-trash"
                                                 actionListener="#{managerEditarCadastroIndividual.limparProfissionalDialog()}"/>
                            </div >
                        </p:tab>

                    </p:tabView>
                </h:form>
            </p:dialog>

            <p:dialog id="responsavelDialog" widgetVar="dialogResponsavel" header="Responsável" dynamic="true"
                      modal="true" appendToBody="false" resizable="false" width="1024px" height="450px" draggable="true" closable="false">
                <h:form id="dialogResponsavelForm">
                    <p:tabView id="responsavelTabView">

                        <p:tab id="pesquisarResponsavelTab" title="Pesquisar Responsável">

                            <p:panel id="responsavelPesquisarPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix both ">
                                <h4 class="title">Selecionar Responsável</h4>

                                <p:outputLabel value="Nome:" styleClass="grid_3" for="nomeInputText" />
                                <p:inputText id="nomeInputText" styleClass="grid_19" 
                                             value="#{ managerEditarCadastroIndividual.responsavelPesquisar.nome }" />
                                <div class="clear"/>

                                <p:outputLabel value="Cartão SUS:" styleClass="grid_3" for="susInputText" />
                                <p:inputText id="susInputText" styleClass="grid_8"  
                                             value="#{ managerEditarCadastroIndividual.responsavelPesquisar.numeroCartaoSus }" />

                                <p:outputLabel value="CPF:" styleClass="grid_3 alpha" for="cpfInputText" />
                                <p:inputText id="cpfInputText" styleClass="grid_8"  
                                             value="#{ managerEditarCadastroIndividual.responsavelPesquisar.cpf }" />
                                <div class="clear"/>

                                <div class="buttonAction">
                                    <p:commandButton actionListener="#{ managerEditarCadastroIndividual.pesquisarResponsavel() }" value="Pesquisar"
                                                     update=":dialogResponsavelForm:responsavelTabView:responsavelPesquisarPanel" 
                                                     process=":dialogResponsavelForm:responsavelTabView:responsavelPesquisarPanel"
                                                     icon="ui-icon-search" />
                                    <p:commandButton value="Cancelar" icon="ui-icon-cancel" oncomplete="dialogResponsavel.hide()" 
                                                     process="@this" update="@this" 
                                                     actionListener="#{managerEditarCadastroIndividual.limparResponsavelDialog()}"/>
                                </div>
                                <br/>

                                <p:dataTable id="responsaveisDataTable" var="item" value="#{ managerEditarCadastroIndividual.responsaveis }" 
                                             rows="5" paginator="true" paginatorPosition="bottom" rowKey="#{ item.id }"
                                             selectionMode="single" emptyMessage="Nenhum profissional encontrado"
                                             style="white-space: pre-wrap;" styleClass="grid_24">

                                    <f:facet name="header">Responsáveis</f:facet>
                                    <p:ajax event="rowSelect" process=":dialogResponsavelForm:responsavelTabView:responsaveisDataTable" update="@this"/>

                                    <p:column headerText="Ação" width="40">
                                        <p:commandButton update=":form:tabView:responsavelPanel" process="@this"
                                                         actionListener="#{managerEditarCadastroIndividual.selecionarResponsavel(item)}"
                                                         alt="Selecionar" icon="ui-icon-check" oncomplete="dialogResponsavel.hide();" />
                                    </p:column>

                                    <p:column headerText="Número Cartão SUS" width="250">
                                        <h:outputText value="#{ item.numeroCartaoSus }" />
                                    </p:column>

                                    <p:column headerText="Nome">
                                        <h:outputText value="#{ item.nome }" />
                                    </p:column>

                                </p:dataTable>

                            </p:panel>

                        </p:tab>

                    </p:tabView>
                </h:form>
            </p:dialog>

            <script type="text/javascript" src="media/js/autoNumeric.js"></script>

            <link rel="stylesheet" type="text/css" href="media/css/cadastroIndividual.css"  />
        </ui:define>
    </ui:composition>

</html>
